<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('发货单列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>发货单据编码：</label>
                            <input type="text" name="billOfParcelsCode"/>
                        </li>
                        <li>
                            <label>来源：</label>
                            <input type="text" name="sourceId"/>
                        </li>
                        <li>
                            <label>供应商编码：</label>
                            <input type="text" name="supplierCode"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:parcels:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="system:parcels:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:parcels:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:parcels:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:parcels:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:parcels:remove')}]];
    var prefix = ctx + "system/parcels";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "发货单",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'billOfParcelsCode',
                    title: '发货单据编码'
                },
                {
                    field: 'sourceId',
                    title: '来源'
                },
                {
                    field: 'supplierCode',
                    title: '供应商编码'
                },
                {
                    field: 'warehouseCode',
                    title: '仓库编码'
                },
                {
                    field: 'state',
                    title: '1待取件,2配送中,3已签收,4已入库'
                },
                {
                    field: 'storagePrice',
                    title: '仓储费'
                },
                {
                    field: 'categoryId',
                    title: '商品分类id'
                },
                {
                    field: 'goodsTotalNum',
                    title: '商品总数量'
                },
                {
                    field: 'goodsVolume',
                    title: '商品总体积'
                },
                {
                    field: 'goodsWeight',
                    title: '商品总重量'
                },
                {
                    field: 'goodsBoxTotalNum',
                    title: '货箱总数'
                },
                {
                    field: 'deliveryPrice',
                    title: '配送费'
                },
                {
                    field: 'pickupCode',
                    title: '取货码'
                },
                {
                    field: 'pickupEndTime',
                    title: '取件结束时间'
                },
                {
                    field: 'pickupAddress',
                    title: '取件地址'
                },
                {
                    field: 'pickupStartTime',
                    title: '取件开始时间'
                },
                {
                    field: 'deliveryType',
                    title: '配送方式:1自配送,2平台配送'
                },
                {
                    field: 'createUser',
                    title: '创建人'
                },
                {
                    field: 'createDate',
                    title: '创建时间'
                },
                {
                    field: 'updateUser',
                    title: '更新人'
                },
                {
                    field: 'updateDate',
                    title: '更新时间'
                },
                {
                    field: 'isDelete',
                    title: '删除字段：0,删除 1：正常'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>